package com.hmz.backend.controller.friend;

import cn.hutool.json.JSONObject;
import com.hmz.backend.service.friend.AddFriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class AddFriendController {
    @Autowired
    private AddFriendService addFriendService;
    @PostMapping("/addfriend")
    public JSONObject addFriend(@RequestBody JSONObject data){
        System.out.println("添加好友接口调用");
        return addFriendService.addFriend(data);
    }
    @PostMapping("/friendRequest")
    public JSONObject friendRequest(@RequestBody JSONObject data){
        System.out.println("添加好友申请接口调用");
        return addFriendService.friendRequest(data);
    }
    @GetMapping("/getFriendRequest")
    public  JSONObject getFriendRequest(@RequestParam int userId){
        System.out.println("获取好友申请接口调用");
        return addFriendService.getFriendRequest(userId);
    }

}
